import type { BannerItem, HomeCategory, HomeHot, GuessItem } from '@/types/home'
import type { PageResult, pageParams } from '@/types/global'
import { http } from '@/utils/http/http'
// 首页接口

/**
 * 首页获取广告图
 * @param distributionSite 广告区域位置信息 1 首页 2 商品推荐
 */
export const getBannerList = (distributionSite = 1) => {
  return http<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}

/**
 * 获取分类数据
 */
export const getHomeCategoryApi = () => {
  return http<HomeCategory[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}
/**
 * 获取热门推荐
 */
export const getHomeHotApi = () => {
  return http<HomeHot[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}
/**
 * 猜你喜欢
 * @param page 页数
 * @param pageSize 每页个数
 */
export const gethomegoodsguessLikeApi = (data?: pageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
